{"ast":null,"code":"import { useMemo } from 'react';\n\n/**\n * Get sticky column offset width\n */\nfunction useStickyOffsets(colWidths, columnCount, direction) {\n  var stickyOffsets = useMemo(function () {\n    var leftOffsets = [];\n    var rightOffsets = [];\n    var left = 0;\n    var right = 0;\n    for (var start = 0; start < columnCount; start += 1) {\n      if (direction === 'rtl') {\n        // Left offset\n        rightOffsets[start] = right;\n        right += colWidths[start] || 0; // Right offset\n\n        var end = columnCount - start - 1;\n        leftOffsets[end] = left;\n        left += colWidths[end] || 0;\n      } else {\n        // Left offset\n        leftOffsets[start] = left;\n        left += colWidths[start] || 0; // Right offset\n\n        var _end = columnCount - start - 1;\n        rightOffsets[_end] = right;\n        right += colWidths[_end] || 0;\n      }\n    }\n    return {\n      left: leftOffsets,\n      right: rightOffsets\n    };\n  }, [colWidths, columnCount, direction]);\n  return stickyOffsets;\n}\nexport default useStickyOffsets;","map":{"version":3,"names":["useMemo","useStickyOffsets","colWidths","columnCount","direction","stickyOffsets","leftOffsets","rightOffsets","left","right","start","end","_end"],"sources":["/data/messenger.client/node_modules/rc-table/es/hooks/useStickyOffsets.js"],"sourcesContent":["import { useMemo } from 'react';\n\n/**\n * Get sticky column offset width\n */\nfunction useStickyOffsets(colWidths, columnCount, direction) {\n  var stickyOffsets = useMemo(function () {\n    var leftOffsets = [];\n    var rightOffsets = [];\n    var left = 0;\n    var right = 0;\n\n    for (var start = 0; start < columnCount; start += 1) {\n      if (direction === 'rtl') {\n        // Left offset\n        rightOffsets[start] = right;\n        right += colWidths[start] || 0; // Right offset\n\n        var end = columnCount - start - 1;\n        leftOffsets[end] = left;\n        left += colWidths[end] || 0;\n      } else {\n        // Left offset\n        leftOffsets[start] = left;\n        left += colWidths[start] || 0; // Right offset\n\n        var _end = columnCount - start - 1;\n\n        rightOffsets[_end] = right;\n        right += colWidths[_end] || 0;\n      }\n    }\n\n    return {\n      left: leftOffsets,\n      right: rightOffsets\n    };\n  }, [colWidths, columnCount, direction]);\n  return stickyOffsets;\n}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